package zhtt.oneToMany4_oneself;

import org.junit.Test;
import zhtt.JunitTestUtil;

/**
 * Created by zhtt on 2017/4/11.
 */
public class JunitTest4 extends JunitTestUtil {

    @Test
    /**
     * 执行三次插入     */
    public void save1(){
        try{
            session.beginTransaction();
            Column parent=new Column("1");
            Column child1=new Column("2");
            Column child2=new Column("3");
            parent.getChildColumn().add(child1);
            parent.getChildColumn().add(child2);
            session.save(parent);
            session.getTransaction().commit();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
